import request from '@/utils/request'

export function add(data) {
    return request({
        url: 'api/basUnit/addOrSave',
        method: 'post',
        data
    })
}

export function del(ids) {
    return request({
        url: 'api/basUnit/',
        method: 'delete',
        data: ids
    })
}

export function getUnitList(params) {
    return request({
        url: 'api/basUnit',
        method: 'get',
        params
    })
}

export function edit(data) {
    return request({
        url: 'api/basUnit/addOrSave',
        method: 'post',
        data
    })
}

export function enableOrDisable(data) {
    const obj = {
        url: 'api/basUnit/enableOrDisable',
        method: 'post',
        data
    }
    return request(obj)
}

export default {add, edit, del, enableOrDisable}
